package com.lidong.framework.jackjson;

import java.io.IOException;
import java.util.Date;

import com.lidong.framework.util.DateUtil;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

/**
 * @Description: 
 * @author gc.nie
 * @date 2013-11-25 下午8:14:04
 * Copyright (c) 2013 Shunwang,Inc. All Rights Reserved.
 */
public class DateJsonSerializerYMDHM extends JsonSerializer<Date> {

	@Override
	public void serialize(Date date, JsonGenerator jsonGenerator,
			SerializerProvider serializerProvider) throws IOException,
			JsonProcessingException {
		jsonGenerator.writeString(DateUtil.format(date, "yyyy-MM-dd HH:mm"));
	}

}
